package maple

object CloseTest {
  /**
    * 闭包
    * @param args
    */
  def main(args: Array[String]): Unit = {

    println(s"a: ${a(10)}   b:  ${b(5)}")

  }

  def mulby(factor:Double) = (x:Double) => x * factor

  val a = mulby(0.5)
  val b = mulby(1.5)
}
